Sunan at-Tirmithiy كتاب الطهارة باب ما جاء من الرخصة فى ذلك

حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ وَمُحَمَّدُ بْنُ الْمُثَنَّى قَالاَ حَدَّثَنَا وَهْبُ بْنُ جَرِيرٍ حَدَّثَنَا أَبِى عَنْ مُحَمَّدِ بْنِ إِسْحَاقَ عَنْ أَبَانَ بْنِ صَالِحٍ عَنْ مُجَاهِدٍ عَنْ جَابِرِ بْنِ عَبْدِ اللَّهِ قَالَ نَهَى النَّبِىُّ صلى الله عليه وسلم أَنْ نَسْتَقْبِلَ الْقِبْلَةَ بِبَوْلٍ فَرَأَيْتُهُ قَبْلَ أَنْ يُقْبَضَ بِعَامٍ يَسْتَقْبِلُهَا. وَفِى الْبَابِ عَنْ أَبِى قَتَادَةَ وَعَائِشَةَ وَعَمَّارِ بْنِ يَاسِرٍ. قَالَ أَبُو عِيسَى حَدِيثُ جَابِرٍ فِى هَذَا الْبَابِ حَدِيثٌ حَسَنٌ غَرِيبٌ.
The Prophet, peace and blessings of God be upon him, restricted us from facing the direction of prayer(1) while urinating. Then, a year before he passed away, I saw him, peace and blessings of God be upon him, facing it (while urinating). (2) Footnotes: (1) (Qiblah): The direction Muslims face during prayer wherever they are in the world; towards the Ka'bah in Makkah. (2) As per the tafsīr, this ḥadīth does not convey a prohibition rule, which some take as an indication of allowance. However, there are other aḥādīth prohibiting this act. This particular incident is considered an exception and not a general rule of allowance. Click on ḥadīth to read more